#ifndef SINGLETON_H
#define SINGLETON_H

template<typename TSingle>
class Singleton
{
public:
	static TSingle* Instance()
	{
		if(_stpSingleType == nullptr)
		{
			_stpSingleType = new TSingle();
		}

		return _stpSingleType;
	}

protected:
	Singleton() {}
	~Singleton() {}
	static TSingle * _stpSingleType;
};

template<typename TSingle>
TSingle* Singleton<TSingle>::_stpSingleType = nullptr;

#endif //SINGLETON_H
